![]() |
PATH![]() |
![]() ![]() |
When your application calls a Navigation Services function that creates a dialog box, you pass a pointer to a
NavReplyRecord
structure. Navigation Services, in turn, uses this structure to provide your application with information about the user's interactions with the dialog box. When your application is through using the structure, remember to dispose of it by calling the function
NavDisposeReply
.
struct NavReplyRecord {
UInt16 version;
Boolean validRecord;
Boolean replacing;
Boolean isStationery;
Boolean translationNeeded;
AEDescList selection;
ScriptCode keyScript;
FileTranslationSpec **fileTranslation;
};
NavDisposeReply
. You can determine the number of items in the list by calling the Apple Event Manager function
AECountItems
. Some dialog boxes may return one or more items; a Save dialog box will always return one. Each selected HFS file object is described in an
AEDesc
structure by the descriptor type
typeFSS
. You can coerce this descriptor into an
FSSpec
structure to perform operations such as opening the file. For more information, see Obtaining Object Descriptions. For more information on Apple event structures and functions, see
Inside Macintosh: Interapplication Communication
. For more information on
FSSpec
structures, see
Inside Macintosh: Files
.The NavDialogOptions structure contains dialog box configuration settings you can pass to several Navigation Services functions.
struct NavDialogOptions {
UInt16 version;
NavDialogOptionFlags dialogOptionFlags;
Point location;
Str255 clientName;
Str255 windowTitle;
Str255 actionButtonLabel;
Str255 cancelButtonLabel;
Str255 savedFileName;
Str255 message;
UInt32 preferenceKey;
Handle popupExtension;
};
NavGetFile
to open text files and a different set of preferences when opening movie files. If you do not wish to provide a preference key, specify zero for the
preferenceKey
value.NavMenuItemSpec
used to add extra menu items to the Show pop-up menu in an Open dialog box or the Format pop-up menu in Save dialog boxes. Using
NavMenuItemSpec
structures allows your application to add additional document types to be opened or saved, or different ways of saving a file (with or without line breaks, for example). For more information, see Customizing Type Pop-up Menus. Your application uses the NavMenuItemSpec structure to define additional items in an Open dialog box's Show pop-up menu or a Save dialog box's Format pop-up menu. For a description of how to add menu items, see Customizing Type Pop-up Menus. For information about file creators and file types, see Inside Macintosh: Macintosh Toolbox Essentials .
struct NavMenuItemSpec {
UInt16 version;
OSType menuCreator;
OSType menuType;
Str255 menuItemName;
};
The NavFileOrFolderInfo structure contains file or folder information for use by your application-defined filter function. For more information, see Filtering File Objects.
struct NavFileOrFolderInfo {
UInt16 version;
Boolean isFolder;
Boolean visible;
UInt32 creationDate;
UInt32 modificationdate;
union {
struct {
Boolean locked; /* file is locked */
Boolean resourceOpen; /* resource fork is open */
Boolean dataOpen; /* data fork is open */
Boolean reserved1;
UInt32 dataSize; /* size of data fork */
UInt32 resourceSize; /* size of resource fork */
FInfo finderInfo; /* see IM: MTE */
FXInfo finderXInfo; /* see IM: MTE */
} fileInfo;
struct {
Boolean shareable; /* volume can be shared */
Boolean sharePoint; /* volume is being shared */
Boolean mounted; /* volume is mounted */
Boolean readable; /* volume is readable */
Boolean writeable; /* volume is writeable */
Boolean reserved2;
UInt32 numberOfFiles; /* number of files in folder */
DInfo finderDInfo; /* see IM: MTE */
DXInfo finderDXInfo; /* see IM: MTE */
char reserved3[214]; /*
} folderInfo
} fileAndFolder;
};
typedef struct NavFileOrFolderInfo NavFileOrFolderInfo;
Your filter function can determine whether the currently selected object is a file by checking the isFolder field of the NavFileOrFolderInfo structure for the value false . After making this determination, you can obtain more information about the object from the fileAndFolder structure.
Note
The information in this structure is valid only for HFS file objects.
The NavCBRec structure provides customization information for your application-defined functions.
struct NavCBRec {
UInt16 version;
NavContext context;
WindowPtr window;
Rect customRect;
Rect previewRect;
NavEventDataInfo eventData;
};
NavCustomControl
. When Navigation Services calls your event-handling function, your application can obtain this value from the
context
field.NavEventData
.
The
NavEventData
structure contains a structure of type NavEventDataInfo
; in Navigation Services 1.1, the
NavEventData
structure also contains a field describing the dialog box item last clicked by the user.
struct NavEventData {
NavEventDataInfo eventDataParms;
SInt16 itemHit; /* Nav Svcs 1.1 ONLY */
};
typedef struct NavEventData NavEventData
NavEventDataInfo
.NavLibraryVersion
to ensure Navigation Services 1.1 is installed before you attempt to use this data.The NavEventDataInfo structure provides event-handling data to your application.
union NavEventDataInfo {
EventRecord *event;
void *param;
};
typedef struct NavEventDataInfo NavEventDataInfo;
Your application uses the NavTypeList structure to define a list of file types that your application is capable of opening. Your application passes a pointer to this list to Navigation Services functions that display Open or Save dialog boxes. You may create this list dynamically or reference a Translation Manager 'open' resource.
For a description of how to use the NavTypeList structure, see Providing File Opening Options. For more information on the 'open' resource and the Translation Manager, see the "Translation Manager" chapter in Inside Macintosh: More Macintosh Toolbox.
struct NavTypeList {
OSType componentSignature;
short reserved;
short osTypeCount;
OSType osType[1];
};
If you create an event-handling function, it must accept certain input parameters, as defined by the NavEventProcPtr data type. For more information on implementing an event-handling function, see MyEventProc. For a sample code listing, see A sample event-handling function.
typedef pascal void (*NavEventProcPtr)
( NavEventCallbackMessage callBackSelector,
NavCBRecPtr callBackParms,
void *callBackUD);
If you create a preview function, it must accept certain input parameters, as defined by the NavPreviewProcPtr data type. For more information on implementing a preview function, see MyPreviewProc.
typedef pascal Boolean (*NavPreviewProcPtr)
( NavCBRecPtr callBackParms,
void *callBackUD );
If you create a filter function, it must accept certain input parameters, as defined by the NavFilterProcPtr data type. For more information on implementing a filter function, see MyFilterProc. For a sample code listing, see A sample filter function.
typedef pascal Boolean (*NavObjectFilterProcPtr)
(AEDesc *theItem,
void *info,
void *callBackUD,
NavFilterModes filterMode);
Previous | Back Up One Level | Next |